package modelo;
// default package
// Generated 25/10/2014 12:52:25 by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Imagenesxsalon generated by hbm2java
 */
@Entity
@Table(name = "imagenesxsalon", catalog = "eventos_compartidos")
public class Imagenesxsalon implements java.io.Serializable {

	private Integer idImagen;
	private Salon salon;
	private int idSalon;
	private byte[] imagen;

	public Imagenesxsalon() {
	}

	public Imagenesxsalon(Salon salon, int idSalon, byte[] imagen) {
		this.salon = salon;
		this.idSalon = idSalon;
		this.imagen = imagen;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "salon"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "idImagen", unique = true, nullable = false)
	public Integer getIdImagen() {
		return this.idImagen;
	}

	public void setIdImagen(Integer idImagen) {
		this.idImagen = idImagen;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Salon getSalon() {
		return this.salon;
	}

	public void setSalon(Salon salon) {
		this.salon = salon;
	}

	@Column(name = "idSalon", nullable = false)
	public int getIdSalon() {
		return this.idSalon;
	}

	public void setIdSalon(int idSalon) {
		this.idSalon = idSalon;
	}

	@Column(name = "imagen", nullable = false)
	public byte[] getImagen() {
		return this.imagen;
	}

	public void setImagen(byte[] imagen) {
		this.imagen = imagen;
	}

}
